﻿using DotNetty.Transport.Channels;
using PSAMMatrixCloud.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;

namespace PSAMMatrixCloud.TransferSecret.LaneMutual
{
    /// <summary>
    /// 会话信息
    /// </summary>
    public class SessionInfo
    {
        /// <summary>
        /// 通道地址
        /// </summary>
        public EndPoint ChannelRemoteAddress
        {
            get;
            set;
        }

        /// <summary>
        /// 会话ID
        /// </summary>
        public string SessionID
        {
            get;
            set;
        }

        /// <summary>
        /// 设备ID
        /// </summary>
        public string DeviceID
        {
            get;
            set;
        }

        /// <summary>
        /// 设备名称或者车道名称
        /// </summary>
        public string DeviceName
        {
            get;
            set;
        } 

        /// <summary>
        /// 设备Key
        /// </summary>
        public string DeviceKey
        {
            get;
            set;
        }

        /// <summary>
        /// 矩阵编号
        /// </summary>
        public string PSAMMatrixNo
        {
            get;
            set;
        }

        /// <summary>
        /// 矩阵通讯通道
        /// </summary>
        public string PSAMMatrixChannelNo
        {
            get;
            set;
        }

        /// <summary>
        /// PSAM编号
        /// </summary>
        public string PSAMNo 
        {
            get;
            set;
        }

        /// <summary>
        /// terminal编号
        /// </summary>
        public string TerminalNo 
        {
            get;
            set;
        }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime
        {
            get;
            set;
        }

        /// <summary>
        /// 命令类型
        /// </summary>
        public DeviceCommandTypeAsk CommandType
        {
            get;
            set;
        }

        /// <summary>
        /// 交易时间
        /// </summary>
        public DateTime? TransTime
        {
            get;
            set;
        }

        /// <summary>
        /// 最近访问时间
        /// </summary>
        public DateTime LastAccessTime
        {
            get;
            set;
        }
    }

    /// <summary>
    /// 通讯通道会话
    /// </summary>
    public class ChannelSession
    {
        /// <summary>
        /// 通讯通道
        /// </summary>
        public IChannel channel
        {
            get;
            set;
        }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime
        {
            get;
            set;
        }
    }
}
